using System;
using Provausio.Common.Objects;
using TrainingManagement.api.Models.Data.CRUD;
using TrainingManagement.api.Models.Data.CRUD.Location;

namespace TrainingManagement.api.Models.BusinessLogic.Location
{
    public class LocationDeleteOperation : BusinessOperation<int, bool>
    {
        readonly LocationDeleteDataSource _locationDelete = new LocationDeleteDataSource();

        public override bool Run(int input)
        {
            if (_locationDelete.Execute(input))
                return true;
            throw new Exception("Location deletion failed.");
        }
    }
}